﻿using System;
using System.Linq;

namespace TimeMachine.Engine
{
	public static class TypeExtensions
	{
		public static TMetadata GetMetadata<TMetadata>(this Type t)
		{
			return t.GetCustomAttributes(typeof (TMetadata), true).Cast<TMetadata>().Single();
		}
	}
}